import 'package:flutter_test/flutter_test.dart';
import 'package:aikit_plugin/aikit_plugin.dart';
import 'package:aikit_plugin/aikit_plugin_platform_interface.dart';
import 'package:aikit_plugin/aikit_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAikitPluginPlatform
    with MockPlatformInterfaceMixin
    implements AikitPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<String?> initSDK(String APPID, String APIKEY, String APISECRET) {
    // TODO: implement initSDK
    throw UnimplementedError();
  }

  @override
  Stream<TransResult> onResult() {
    // TODO: implement onResult
    throw UnimplementedError();
  }

  @override
  Future<String?> startRecord(String keyword) {
    // TODO: implement startRecord
    throw UnimplementedError();
  }

  @override
  Future<String?> stopRecord() {
    // TODO: implement stopRecord
    throw UnimplementedError();
  }
}

void main() {
  final AikitPluginPlatform initialPlatform = AikitPluginPlatform.instance;

  test('$MethodChannelAikitPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAikitPlugin>());
  });

  test('getPlatformVersion', () async {
    AikitPlugin aikitPlugin = AikitPlugin();
    MockAikitPluginPlatform fakePlatform = MockAikitPluginPlatform();
    AikitPluginPlatform.instance = fakePlatform;

    expect(await aikitPlugin.getPlatformVersion(), '42');
  });
}
